package cn.edu.scau.cmi.guihao.simpleFactory;

import cn.edu.scau.cmi.guihao.domin.simpleFactory.AutomobileDamage;
import cn.edu.scau.cmi.guihao.domin.simpleFactory.BodilyInjury;
import cn.edu.scau.cmi.guihao.domin.simpleFactory.Casualties;
import cn.edu.scau.cmi.guihao.interProgramming.simpleFactory.InsuranceClaims;

public class InsuranceForSimpleFactory {
	public static InsuranceClaims createInsurance(String type,String name) {
		if(type=="身体受伤") {
			return new BodilyInjury(name);
		}else if(type=="汽车损坏") {
			return new AutomobileDamage(name);
		}else if(type=="人员伤亡") {
			return new Casualties(name);
		}else {
			return null;
		}
	}
}
